@extends('admin/layouts/master')
@section('content')
    <div class="col-sm-9">
        <ul class="nav nav-tabs" role="tablist">
            <li class="nav-item">
                <a class="nav-link active" href="/admin/category">栏目列表</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/admin/category/create">添加栏目</a>
            </li>
        </ul>
        <table class="table table-hover">
            <thead>
            <tr>
                <th scope="col">#序号</th>
                <th scope="col">栏目名称</th>
                <th scope="col">封面栏目</th>
                <th scope="col">操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($data as $d)
                <tr>
                    <th scope="row">{{$d['id']}}</th>
                    <td>{{$d['catename']}}</td>
                    <td>
                        @if($d['ishome']==1)
                            <i class="fa fa-check-circle alert-success"></i>
                        @else
                            <i class="fa fa-times-circle"></i>
                        @endif
                    </td>
                    <td>
                        <div class="btn-group btn-group-sm" role="group" aria-label="...">
                            <a href="/admin/category/{{$d['id']}}/edit" class="btn btn-default">编辑</a>
                            <a href="javascript:;" onclick="del({{$d['id']}})" class="btn btn-default">删除</a>
                        </div>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
@endsection
